package com.efesco.service.hirefire;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.efesco.common.CommUtil;

/**
 * M_hire_fire_dataset_hire_fire_listListener
 */
public class M_hire_fire_dataset_hire_fire_listListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {
		SqlDataset ds = (SqlDataset) dataset;
		String sql = "select icst.in_char_service_transaction_id,sc.company_chinese_name," +
				"e.*,ehf.*,cbm.businessman_id from s_employee_hire_fire ehf,s_in_char_service_transaction icst," +
				"s_in_char_list icl,s_employee e,s_single_company sc,s_employee_on_off_post eoop,s_company_businessman cbm,[table] where " +
				"ehf.in_char_service_transaction_id=icst.in_char_service_transaction_id and " +
				"icl.in_char_id=icst.in_char_id and e.employee_id=icl.employee_id and cbm.single_company_id=sc.single_company_id and" +
				" eoop.single_company_id=sc.single_company_id and" +
				" icl.employee_on_off_id=eoop.employee_on_off_id and ehf.status in(1,2,3,4) AND [field] ";
		sql +="and sc.foreign_enterprise_id="+CommUtil.getForeignEnterpriseId()+" ";
		sql = CommUtil.getRoleSql(sql, "sc");
		sql += CommUtil.setConditionSQL(ds);
		ds.setSql(sql);
    return true;
  }

}
